<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var a = 20;
			function setNumber(){
				var a=10;
				document.write('局部变量：' + a)
			}
			setNumber();
			document.write('<br>');
			document.write('全局变量：'+a)
		</script>
	</body>
</html>